home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
George Foreman's Interac…ng, Barbeque & Rotisserie
/
George Foreman's Interactive Guide to Grilling, Barbeque, and Rotisserie.iso
/
j
/
security.js
next >
Wrap
Text File
|
2002-09-21
|
6KB
|
301 lines
isW3C = (document.getElementById) ? true : false;
var nav4 = window.Event ? true : false;
if (isW3C) {
document.onmouseup=disableRightClick;
document.oncontextmenu = disableRightClick;
}
function disableRightClick() {
return false;
}
var isfocus = true;
document.onkeypress=kpress2;
document.onkeyup=kpress;
function kpress(evt){
var keyCode =
document.layers ? evt.which :
document.all ? event.keyCode :
document.getElementById ? evt.keyCode : 0;
if(top.name=='splash') {
} else {
return false;
}
if(top.window.frames.index.window.page==null) {
} else {
if(isfocus) {
top.window.frames.index.window.page.focus();
}
/*=======================================
Following section is to get the key events for navigation
purpose.
=======================================*/
// This is to open Help Window on key F1
if(keyCode == 112 ) {
helpWindow();
return;
}
// This is to open Content Views Window on key F2
if(keyCode == 113 ) {
viewWindow();
return;
}
// This is to open Advance Search Window on key F3
if(keyCode == 114 ) {
advanceSearchWindow();
return;
}
// This is to open Quick Search Window on key F4
if(keyCode == 115 ) {
quickSearch();
return;
}
// This is the conidtion for finding right arrow key without
// Ctrl key pressed to go to next page
if(!isCtrlKeyPressed(evt) &&keyCode == 39|| !isCtrlKeyPressed(evt) &&keyCode == 34) {
nextPage();
return;
}
// This is the conidtion for finding left arrow key without
// Ctrl key pressed to go to previous page
if(!isCtrlKeyPressed(evt) &&keyCode == 37||!isCtrlKeyPressed(evt) &&keyCode == 33 ) {
prevPage();
return;
}
// This is the conidtion for finding right arrow key with
// Ctrl key pressed to go to next section
if(isCtrlKeyPressed(evt) &&keyCode == 39 ) {
nextSection();
return;
}
// This is the conidtion for finding left arrow key with
// Ctrl key pressed to go to previous page
if(isCtrlKeyPressed(evt) &&keyCode == 37 ) {
prevSection();
return;
}
// This is to get the event of Home to go to first page
if(keyCode == 36 ) {
firstPage();
return;
}
// This is to get the event of End to go to last page
if(keyCode == 35 ) {
lastPage();
return;
}
// This is to get the event of Back button to go to back page
if(isCtrlKeyPressed(evt) &&keyCode == 8 ) {
backPage();
return;
}
// This is to get the event of F5 to go to reload page
if(keyCode == 116 ) {
reload();
return;
}
// This is to get the event of Crl + R to go to reload page
if(isCtrlKeyPressed(evt) &&keyCode == 82 ) {
reload();
return;
}
// This is to get the event of Ctrl + N to focus on goto page
if(isCtrlKeyPressed(evt) &&keyCode == 78 ) {
gotoPage();
return false;
}
}
if(keyCode==40|keyCode==38) {
if(name == 'page') {
} else {
top.window.frames.index.window.page.focus();
}
return true;
}
return false;
}
function nextPage() {
if(name=='page'||name=='tocdis')
parent.getNextPage();
else
getNextPage();
}
function prevPage() {
if(name=='page'||name=='tocdis')
parent.getPrevPage();
else
getPrevPage();
}
function nextSection() {
if(name=='page'||name=='tocdis')
parent.getNextSection();
else
getNextSection();
}
function prevSection() {
if(name=='page'||name=='tocdis')
parent.getPrevSection();
else
getPrevSection();
}
function firstPage() {
if(name=='page'||name=='tocdis')
parent.getFirstPage();
else
getFirstPage();
}
function lastPage() {
if(name=='page'||name=='tocdis')
parent.getLastPage();
else
getLastPage();
return;
}
function backPage() {
if(name=='page'||name=='tocdis')
parent.getBackPage();
else
getBackPage();
}
function reload() {
location.reload();
}
function gotoPage() {
if(name=='page'||name=='tocdis')
parent.document.go.dpg.focus();
else
document.go.dpg.focus();
}
function viewWindow() {
if(name=='page'||name=='tocdis')
parent.ViewWindow();
else
ViewWindow();
}
function helpWindow() {
if(name=='page'||name=='tocdis')
parent.openHelpWindow();
else
openHelpWindow();
}
function advanceSearchWindow() {
if(name=='page'||name=='tocdis')
parent.openAdvanceSearch();
else
openAdvanceSearch();
}
function quickSearch() {
if(name=='page'||name=='tocdis')
parent.document.search.query.focus();
else
document.search.query.focus();
}
function metadataWindow() {
}
// This function checks if the Alt key is pressed or not
// It checks for the browser compatibility and then
// returns the appropriate value
function isAltKeyPressed(evt) {
var isAlt = false;
// if this is netscape browser
if(nav4) {
isAlt = evt.altKey;
}
// else if it is a IE Browser
else {
isAlt = window.event.altKey;
}
return isAlt;
}
// This function checks if the Alt key is pressed or not
// It checks for the browser compatibility and then
// returns the appropriate value
function isCtrlKeyPressed(evt) {
var isCtrl = false;
// if this is netscape browser
if(nav4) {
isCtrl = evt.ctrlKey;
}
// else if it is a IE Browser
else {
isCtrl = window.event.ctrlKey;
}
return isCtrl;
}
function kpress2(evt){
var keyCode =
document.layers ? evt.which :
document.all ? event.keyCode :
document.getElementById ? evt.keyCode : 0;
//alert(keyCode);
if(keyCode == 40 || keyCode == 38) {
return true;
}
return false;
}